/**
 * color utilities
 * Copyright (c) 2009 cmiscm.com
 * date of final modification : 2010. 01. 06
*/
package com.cmiscm.utils.color
{
	import flash.geom.ColorTransform;
	
	/**
	 * Color Utilities.
     * 
     */
	public class ColorUtilities
	{
		/**
		 * return rgb in order to use Between
		 * <p>
		 * Between에서 colorTransform사용시 rgb리턴
		 * @param $change_color Change color
		 * @param $color Original Color
		 * @return 
		 * 
		 */			
		public static function rgb($change_color:uint, $color:uint=0):Object
		{
			if ($color == $change_color) {
				return {colorTransform:{redOffset:0, greenOffset:0, blueOffset:0}};
			} else {
				var myColor:ColorTransform = new ColorTransform();
				myColor.color = $color;	
				var changeColor:ColorTransform = new ColorTransform();
				changeColor.color = $change_color;
				return {colorTransform:{redOffset:changeColor.redOffset - myColor.redOffset, greenOffset:changeColor.greenOffset - myColor.greenOffset, blueOffset:changeColor.blueOffset - myColor.blueOffset}};
			}
		}
	}
}